﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Root="clr-namespace:Elysium.Theme">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Elysium.Theme;component/Themes/SharedResources.xaml"/>
    </ResourceDictionary.MergedDictionaries>
    
    <Style TargetType="{x:Type ContextMenu}">
        
        <Setter Property="Background" Value="{StaticResource Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ForegroundLowlight}"/>
        <Setter Property="BorderThickness" Value="{x:Static Root:Parameters.DefaultThickness}"/>
        <Setter Property="Foreground" Value="{StaticResource Foreground}"/>
        <Setter Property="FontFamily" Value="{x:Static Root:Parameters.FontFamily}"/>
        <Setter Property="FontSize" Value="{x:Static Root:Parameters.TextFontSize}"/>
        <Setter Property="FontWeight" Value="Normal"/>

        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="{x:Static Root:Parameters.BoldPadding}"/>

        <Setter Property="Grid.IsSharedSizeScope" Value="True"/>
        
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            TextBlock.Foreground="{TemplateBinding Foreground}"
                            TextBlock.FontFamily="{TemplateBinding FontFamily}"
                            TextBlock.FontSize="{TemplateBinding FontSize}"
                            TextBlock.FontWeight="{TemplateBinding FontWeight}"
                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <StackPanel IsItemsHost="True"
                                    KeyboardNavigation.DirectionalNavigation="Cycle"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        
    </Style>

</ResourceDictionary>